Skip to content

[stable32] Fix handling of "enableScripting" data attribute#1397

Merged
danxuliu merged 3 commits intostable32from
backport/1396/stable32
Apr 4, 2026
Merged

[stable32] Fix handling of "enableScripting" data attribute#1397
danxuliu merged 3 commits intostable32from
backport/1396/stable32

Conversation

@backportbot
Copy link
Copy Markdown

@backportbot backportbot Bot commented Mar 25, 2026

Backport of #1396

danxuliu added 2 commits April 5, 2026 01:41
In PHP, a boolean is converted to a string as either "1" or "" rather
than to "true" or "false". Moreover, the value of the data attribute is
always returned as a string in JavaScript, so it never matched a strict
comparison against a boolean value.

It would be possible to fix this by comparing against "1" in Javascript.
However, for clarity (and given that semantically an existing data
attribute would be considered a boolean true if present, even if empty),
now the "enableScripting" data attribute is explicitly set to either
"true" or "false" and the comparison in JavaScript is done against a
string "true".

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@danxuliu danxuliu force-pushed the backport/1396/stable32 branch from cc50d13 to 13405f4 Compare April 4, 2026 23:42
@danxuliu
Copy link
Copy Markdown
Member

danxuliu commented Apr 4, 2026

/compile /

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@danxuliu danxuliu marked this pull request as ready for review April 4, 2026 23:50
Copy link
Copy Markdown
Member

@danxuliu danxuliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works 👍

@danxuliu danxuliu merged commit c9146e5 into stable32 Apr 4, 2026
44 checks passed
@danxuliu danxuliu deleted the backport/1396/stable32 branch April 4, 2026 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants